package com.spring.demo.component;

import com.spring.demo.entity.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Order(1)
public class StudentBeans1 {
    @Bean // 使用Bean注解讲函数的返回值也就是Student对象存储到spring中

    public Student getStudent(){
        Student student = new Student("jordan");
        student.setAge(18);
        student.setPassword("123456");
        return student;
    }
}
